//
//  YCCatStyleDescViewController.m
//  YCSchool
//
//  Created by yanglinxia on 16/4/29.
//  Copyright © 2016年 yanglinxia. All rights reserved.
//  车型说明

#import "YCCarStyleDescViewController.h"
#import "YCCarStyleCell.h"

@interface YCCarStyleDescViewController ()<UITableViewDelegate,UITableViewDataSource>

/** tableView */
@property (nonatomic, strong) UITableView *tableView;
/** 数据  */
@property (nonatomic, strong) NSMutableArray *dataArray;

@end

@implementation YCCarStyleDescViewController

- (UITableView *)tableView
{
    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.yc_width, self.view.yc_height-64) style:UITableViewStylePlain];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.dataSource = self;
        _tableView.delegate = self;
        _tableView.backgroundColor = [UIColor yc_colorWithUInt:0xf7f7f7];
    }
    return _tableView;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"车型介绍";
    UINavigationBar *bar = self.navigationController.navigationBar;
    [bar setShadowImage:[UIImage yc_imageWithColor:[UIColor clearColor] size:CGSizeMake(kScreenWidth, 1)]];
    [bar setBackgroundImage:[UIImage yc_imageWithColor:[UIColor yc_colorWithUInt:0xf7f7f7] size:CGSizeMake(kScreenWidth, 64)] forBarMetrics:UIBarMetricsDefault];
    
    [self yc_addBackBarButtonItem];
    [self.view addSubview:self.tableView];
    self.tableView.contentInset = UIEdgeInsetsMake(12, 0, 0, 0);//18 = 12 + 6
    self.tableView.rowHeight = heightFromIphone6Height(135);// 123+间距12(上下各6)
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    // 还原导航条背景
    UINavigationBar *bar = self.navigationController.navigationBar;
    [bar setShadowImage:[UIImage yc_imageWithColor:[UIColor clearColor] size:CGSizeMake(kScreenWidth, 1)]];
    [bar setBackgroundImage:[UIImage yc_imageWithColor:[UIColor whiteColor] size:CGSizeMake(kScreenWidth, 64)] forBarMetrics:UIBarMetricsDefault];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


#pragma mark - UITableViewDataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    YCCarStyleCell *cell = [YCCarStyleCell tableViewCellWithTableView:tableView withIndexPath:indexPath];
    cell.contentView.backgroundColor = [UIColor yc_colorWithUInt:0xf7f7f7];
//    cell.itemModel = self.dataArray[indexPath.row];
    return cell;
}

#pragma mark - UITableViewDelegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    YCLogFunc
}


#pragma mark - 点击事件




@end
